﻿using BCCommon;
using BCCommon.TMS.Driver;
using BCDto.Sim.Admin.Admin;
using BCDto.TMS.LearnTrain;
using BCDto.TMS.LearnTrain.LearnTrainStatistics;
using BCDto.TMS.LearnTrain.PendingLearningVehicle;
using BCDto.TMS.LearnTrain.VehicleTrainingScheduleRecord;
using System;
using System.Collections.Generic;
using BCDto.TMS.LearnTrain.VehicleTrainingScheduleRecord.TrainingScheduleRecordRequest;

namespace BCService.TMS.LearningTrain
{
    public interface IPendingLearningVehicleService
    {

        /// <summary>
        /// 获取待培训信息
        /// </summary>
        /// <param name="driverId">司机id</param>
        /// <returns></returns>
        PendingLearningVehicleDto GetPendingLearningVehicle(long driverId);
        /// <summary>
        /// 获取待培训列表（分页）
        /// </summary>
        /// <param name="admin"></param>
        /// <param name="driverName">司机名称</param>
        /// <param name="vehicleNo">车辆编号</param>
        /// <param name="driverRoleType">司机角色</param>
        /// <param name="isTrainingScheduleRecord">是否安排培训</param>
        /// <param name="notifyStartDate">开始日期</param>
        /// <param name="notifyEndDate">结束日期</param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        PageableList<PendingLearningVehicleViewDto> Query(AdminDto admin,string driverName, string vehicleNo, DriverRoleType? driverRoleType,
            bool? isTrainingScheduleRecord, DateTime? notifyStartDate, DateTime? notifyEndDate, int pageIndex, int pageSize);
        /// <summary>
        /// 获取培训记录汇总
        /// </summary>
        /// <param name="vehicleTrainingScheduleRecordId">培训记录id</param>
        /// <returns></returns>
        VehicleTrainingScheduleStatisticsDto GetTrainingScheduleStatistics(long vehicleTrainingScheduleRecordId);
        /// <summary>
        /// 获取培训记录详情
        /// </summary>
        /// <param name="admin">管理员</param>
        /// <param name="vehicleTrainingScheduleRecordId">车辆培训记录id</param>
        /// <param name="phone">手机</param>
        /// <returns></returns>
        IEnumerable<VehicleTrainingScheduleDetailDto> GetVehicleTrainingScheduleDetail(AdminDto admin, long vehicleTrainingScheduleRecordId, string phone);

        /// <summary>
        /// 缺考
        /// </summary>
        /// <param name="admin">管理员</param>
        /// <param name="vehicleTrainingScheduleRecordId">培训期数编号</param>
        /// <param name="pendingLearningVehicleId">待培训编号</param>
        /// <returns></returns>
        bool MissExtension(AdminDto admin, long vehicleTrainingScheduleRecordId, long pendingLearningVehicleId);

        /// <summary>
        /// 允许考试
        /// </summary>
        /// <param name="admin">管理员信息</param>
        /// <param name="vehicleTrainingScheduleRecordId">培训安排记录id</param>
        /// <param name="putDto">数据</param>
        /// <returns></returns>
        bool AllowJoinExam(AdminDto admin,long vehicleTrainingScheduleRecordId, VehicleTrainingScheduleRecordPutDto putDto);
        /// <summary>
        /// 获取培训历史记录
        /// </summary>
        /// <param name="vehicleNo">车牌号</param>
        /// <param name="trainingSiteConfigId">培训点设置id</param>
        /// <param name="admin">管理员信息</param>
        /// <param name="trainingStartDate">培训开始时间</param>
        /// <param name="trainingEndDate">培训结束时间</param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        PageableList<LearnTrainHistoryRecordDto> GetLearnTrainHistoryRecord(AdminDto admin, string vehicleNo, long? trainingSiteConfigId,
            DateTime? trainingStartDate, DateTime? trainingEndDate, int pageIndex, int pageSize);

        #region 进入考场
        /// <summary>
        /// 进入考场统计
        /// </summary>
        /// <param name="vehicleTrainingScheduleRecordId">进入考场统计</param>
        /// <returns></returns>
        ExaminationStatisticsDto GetExaminationStatistics(long vehicleTrainingScheduleRecordId);
        /// <summary>
        /// 获取考试通过和未通过司机信息
        /// </summary>
        /// <param name="vehicleTrainingScheduleRecordId">培训期数编号</param>
        /// <param name="isLearnTrainPassed">是否考试通过</param>
        /// <returns></returns>
        IEnumerable<LearnTrainExaminationDriverDto> GetExaminationDriverInfo(long vehicleTrainingScheduleRecordId, bool isLearnTrainPassed);
        /// <summary>
        /// 获取考试中司机信息
        /// </summary>
        /// <param name="vehicleTrainingScheduleRecordId">培训期数编号</param>
        /// <returns></returns>
        IEnumerable<LearnTrainExaminationDriverDto> GetExaminationHaving(long vehicleTrainingScheduleRecordId);

        #endregion

        #region 统计

        /// <summary>
        /// 司机培训人数统计
        /// </summary>
        /// <param name="agentRecordId">代理商id</param>
        /// <param name="datetime">时间</param>
        /// <param name="trainingSiteConfigId">培训点设置</param>
        /// <returns></returns>
        LearnTrainDto GetLearningDriverCount(long? agentRecordId, DateTime? datetime,long? trainingSiteConfigId);

        /// <summary>
        /// 获取两个月的培训考试通过人数统计
        /// </summary>
        /// <param name="admin">管理员</param>
        /// <param name="date">日期</param>
        /// <returns></returns>
        LearnTrainAnalysisDto GetTrainSeheduleMonthAnalysis(AdminDto admin, DateTime? date);
        /// <summary>
        /// 获取人数
        /// </summary>
        /// <param name="admin">管理员</param>
        /// <param name="datetime">时间</param>
        /// <returns></returns>
        ExamineDriverCountDto QueryFirstExamDriverCount(AdminDto admin, DateTime? datetime);
        /// <summary>
        /// 累计培训人数
        /// </summary>
        /// <param name="admin">管理员</param>
        /// <returns></returns>
        TrainCountDto QueryTrainCountDetailList(AdminDto admin);
        #endregion

    }
}